package com.raos.example.shardingjdbc2basic;

import com.raos.example.shardingjdbc2basic.service.ExampleService;
import com.raos.example.shardingjdbc2basic.service.impl.OrderServiceImpl;

import javax.sql.DataSource;
import java.sql.SQLException;

/**
 * Sharding-Jdbc分库分表实战之实例测试类
 *
 * @author raos
 * @emil 991207823@qq.com
 * @date 2021/8/22 21:13
 */
public class ExampleMain {

    public static void main(String[] args) throws SQLException {
        //被Sharding-JDBC代理的datasource
        DataSource dataSource = ShardingDatabaseAndTableConfiguration.getDatasource();
        ExampleService exampleService = new OrderServiceImpl(dataSource);
        exampleService.initEnvironment();
        exampleService.processSuccess();
    }

}
